package com.mytinyRPC.secondprovider;

import com.mytinyRPC.framework.URL;
import com.mytinyRPC.framework.autoScan.annotate.RpcServiceScan;
import com.mytinyRPC.protocol.http.HttpServer;

/***
 * @Author HP
 * @Description //服务端
 **/
@RpcServiceScan
public class Provider2Application {
    public static void main(String[] args) {
        //LocalRegister localRegister=SingletonFactory.getInstance(LocalRegisterImpl.class);
        //1.本地注册
        //localRegister.regist(MyProviderService.class.getName(), MyProviderServiceImpl.class);

        //2.序列化流远程注册

        //zookeeper远程注册，三个服务器权重分别为5,1,1
        URL url1=new URL("localhost",8080,5);
        URL url2=new URL("localhost",8081,1);
        URL url3=new URL("localhost",8083,1);

        //3.启动tomcat
        HttpServer httpServer1=new HttpServer();
        httpServer1.start(url2);
    }

}
